package exception;

public class ExceptionDemoTest {
    public static void main(String[] args) {
        try {
            checkScore(121);
        } catch (ExceptionDemo exceptionDemo) {
            exceptionDemo.printStackTrace();
        }
    }
    public static void checkScore(int score) throws ExceptionDemo {
        // 0 - 100
        // 不合法
        if (score < 0 || score > 120) {
            throw new ExceptionDemo("分数不合法");
        }else {
            System.out.println("分数正常");
        }

    }
}
